import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpCourseInfo {
  id!: number;
  sid!: number;
  courseId!: number;
  url!: unknown;
  title!: unknown;
  sort!: number;
  duration!: string;
  addTime!: string;
  updateTime!: string;
  uniacid!: number;
  type: boolean = true;
  second!: number;
}

export const ImsYzdKpCourseInfoSchema = new EntitySchema({
  class: ImsYzdKpCourseInfo,
  properties: {
    id: { primary: true, type: 'number' },
    sid: { type: 'number', index: 'sid' },
    courseId: { type: 'number', index: 'course_id' },
    url: { type: 'unknown', columnType: 'longtext' },
    title: { type: 'unknown', columnType: 'longtext' },
    sort: { type: 'number', index: 'sort' },
    duration: { type: 'string', length: 255 },
    addTime: { type: 'string', length: 255 },
    updateTime: { type: 'string', length: 255 },
    uniacid: { type: 'number', index: 'uniacid' },
    type: { type: 'boolean', default: true },
    second: { type: 'number' },
  },
});
